/*
  ODPort.h - 
*/
#ifndef ODPort_h
#define ODPort_h

#include "WProgram.h"

class Port {
  public:
    Port();
    void initInput(uint8_t pin);
    void initOutput(uint8_t pin, uint8_t initStatus);
    void enablePullup();
    void disablePullup();
    uint8_t getStatus();
    void setStatus(uint8_t newStatus);
    void setDebounce(int debounceTime);
    void enableDebug();
  private:
    uint8_t _pin;
    uint8_t _type;
    uint8_t _value;
    uint8_t _status;
    uint8_t _lastSentStatus;
    unsigned long _lastChangeTime;
    int _debounceTime;
    boolean _debug;
    
    void initPort(uint8_t pin, uint8_t type);
    void readPort();
};

#endif